package model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the conversation database table.
 * 
 */
@Entity
public class Conversation implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="conversation_id")
	private int conversationId;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="conversation_datedebut")
	private Date conversationDatedebut;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="conversation_datefin")
	private Date conversationDatefin;

	@Column(name="conversation_etat")
	private int conversationEtat;

	//bi-directional many-to-one association to Projet
	@ManyToOne
	@JoinColumn(name="projet_id")
	private Projet projet;

	//bi-directional many-to-one association to Employe
	@ManyToOne
	@JoinColumn(name="employe_id_receiver")
	private Employe employe1;

	//bi-directional many-to-one association to Employe
	@ManyToOne
	@JoinColumn(name="employe_id_sender")
	private Employe employe2;

	//bi-directional many-to-one association to Message
	@OneToMany(mappedBy="conversation")
	private List<Message> messages;

	public Conversation() {
	}

	public int getConversationId() {
		return this.conversationId;
	}

	public void setConversationId(int conversationId) {
		this.conversationId = conversationId;
	}

	public Date getConversationDatedebut() {
		return this.conversationDatedebut;
	}

	public void setConversationDatedebut(Date conversationDatedebut) {
		this.conversationDatedebut = conversationDatedebut;
	}

	public Date getConversationDatefin() {
		return this.conversationDatefin;
	}

	public void setConversationDatefin(Date conversationDatefin) {
		this.conversationDatefin = conversationDatefin;
	}

	public int getConversationEtat() {
		return this.conversationEtat;
	}

	public void setConversationEtat(int conversationEtat) {
		this.conversationEtat = conversationEtat;
	}

	public Projet getProjet() {
		return this.projet;
	}

	public void setProjet(Projet projet) {
		this.projet = projet;
	}

	public Employe getEmploye1() {
		return this.employe1;
	}

	public void setEmploye1(Employe employe1) {
		this.employe1 = employe1;
	}

	public Employe getEmploye2() {
		return this.employe2;
	}

	public void setEmploye2(Employe employe2) {
		this.employe2 = employe2;
	}

	public List<Message> getMessages() {
		return this.messages;
	}

	public void setMessages(List<Message> messages) {
		this.messages = messages;
	}

}